import request from "@/utils/request";

//获取积分商品列表
export const getIntegralGoodsByPage = (current, size) => request.get('/integralGoods/getIntegralGoodsByPage/' + current + '/' + size)
//获取会员积分列表
export const getPageIntegral = (current, size) => request.get('/integral/getPageIntegral/' + current + '/' + size)
//手机号获取积分
export const getIntegralByPhone = (current, size, phone) => request.get('/integral/getPageIntegral/' + current + '/' + size + '?phone=' + phone)
//根据手机号获取可换商品
export const getExchangeGoodsByPhone = (current, phone) => request.get('/integral/getPhoneIntegralExchange/' + current + '/100?phone=' + phone)
//兑换商品
export const exchangeIt = (data, code) => request.put('/integral/IntegralExchange/' + code, data)
//根据手机号查询兑换历史记录
export const getHistoryExchangeByPhone = phone => request.get('/integralRecord/getPageIntegralRecord/1/100?phone=' + phone)
//添加新的商品
export const saveNewExchangeGood = data => request.post('/integralGoods/saveIntegralGoods', data, {headers: {'Content-Type': 'multipart/form-data'}})
//删除积分商品
export const removeExchangeGoodById = id => request.delete('/integralGoods/deleteIntegralGoods/' + id)
//编辑商品信息
export const updateExchangeGoodInfo = data => request.put('/integralGoods/updateIntegralGoods', data, {headers: {'Content-Type': 'multipart/form-data'}})